function paint(leader,num_machine,num_job,num_op,total_op_num)
%% 绘制全局最优解的甘特图
[~,~,Pvals]=fitness(leader,num_machine,num_job,num_op);
Pval1=Pvals{1,1};
figure(2);
for i=1:total_op_num
    mText=leader(total_op_num+i);%机器
    b=leader(i);%工序
    x1=Pval1(1,i);%各工序开始
    x2=Pval1(2,i); %各工序结束
    y1=mText-0.2;
    y2=mText;
    hold on; 
    fill([x1,x2,x2,x1],[y1,y1,y2,y2],[1-1/b,1/b,b/num_job]);
    text((x1+x2)/2-1,mText+0.1,[num2str(b),'-',num2str(length(find(leader(1:i)==b)))]);
    text((x1+x2)/2,mText-0.3,num2str(leader(2*total_op_num+i)));
end